index.tsx 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. "use client";
  2. import { FC, PropsWithChildren, useState } from "react";
  3. import clsx from "clsx";
  4. import ButtonOwn from "@/components/ButtonOwn";
  5. import "./style.scss";
  6. /**
  7. * @description 登录注册From表单
  8. * @param {string} type 使用类型
  9. * @param {() => void} callbackFun 回调方法
  10. */
  11. export interface FromComProps {
  12. type?: string;
  13. text?: string;
  14. callbackFun?: () => void;
  15. }
  16. const FromCom: FC<PropsWithChildren<FromComProps>> = ({type = 'login', callbackFun}) => {
  17. let [visible, setVisible] = useState(false)
  18. const spanClassName = clsx("iconfont", {
  19. "icon-kejian": visible,
  20. "icon-bukejian": !visible,
  21. });
  22. return (
  23. <div className="FromCom">
  24. <div className="phoneInput">
  25. <span className="after">+55</span>
  26. <input type="tel" placeholder="Número de Celular" maxLength={11}/>
  27. </div>
  28. <div className="passwordInput">
  29. <input type={visible?'text':'password'} placeholder="Senha" />
  30. <span className={spanClassName} onClick={() => setVisible(!visible)}></span>
  31. </div>
  32. <div className="btnContent">
  33. <div className="tips"> O número de telefone não existe. </div>
  34. <ButtonOwn active={true}>{type == 'login'? 'Login' : 'Criar conta'}</ButtonOwn>
  35. </div>
  36. <div className="link">
  37. {
  38. type == 'login' ? (
  39. <>
  40. <span>Esqueci minha senha?</span>
  41. <span>Criar Conta Nova</span>
  42. </>
  43. ) : <span className="active">Já tem uma conta? Log in</span>
  44. }
  45. </div>
  46. </div>
  47. );
  48. };
  49. export default FromCom;